package com.imau.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.HashSet;
import java.util.Set;

@TableName("t_user")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User extends BaseEntity{

    /**用户ID*/
    @TableId(type =  IdType.ASSIGN_ID)
    private String id;
    private String mobile;
    private String userName;
    private String password;

    public User(String mobile) {
        this.mobile = mobile;
    }

    public User(String mobile,String username) {
        this.userName = username;
        this.mobile = mobile;
    }

    /**启用状态 0是禁用，1是启用*/
    private String status;

    /**增加角色的属性  标记不是数据库字段*/
    @TableField(exist = false)
    private Set<Role> roles = new HashSet<>(0);

    /**部门对象*/
    @TableField(exist = false)
    private SysDept dept;
}
